import { defineStore } from 'pinia'

export const useUserInfoStore = defineStore('useUserInfoStore', {
    state: () => {
        return {
            userInfo: {},
        }
    },
    getters: {
        getUserInfo(state) {
            return state.userInfo
        }
    },

    actions: {
        setUserInfo(val) {
            this.userInfo = val
        },

        reset() {
            this.userInfo = {}
        }
    },
    persist: {
        enabled: true,
        strategies: [{
            storage: localStorage,
            key: 'userStore'
        }]
    }
})